/**
 * @file call_log.h
 *
 */
#ifndef CALL_LOG_H
#define CALL_LOG_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
*      INCLUDES
*********************/

#ifdef LV_CONF_INCLUDE_SIMPLE
#include "lvgl.h"
#include "lv_watch_conf.h"
#else
#include "../../../lvgl/lvgl.h"
#include "../../../lv_watch_conf.h"
#endif

#if USE_LV_WATCH_CALL_LOG != 0

/*********************
*      DEFINES
*********************/

/**********************
*      TYPEDEFS
**********************/
enum {
    CALL_STATUS_OUTGOING = 0,
    CALL_STATUS_INCOMING,
    CALL_STATUS_MISSED,
    CALL_STATUS_REJECTED,
};
typedef uint8_t call_status_t;

typedef struct {
    char *phone_number;
    uint8_t index;
} call_log_number_info_t;

typedef struct {
    lv_watch_obj_ext_t lv_watch_obj;
    /*New data for this type */
    lv_ll_t * phone_number_list;
    lv_obj_t * list;
    lv_obj_t * label_tip;
} lv_call_log_obj_ext_t;

/**********************
* GLOBAL PROTOTYPES
**********************/
/**
 * Create a call log application
 */
extern void call_log_create_event_cb(lv_obj_t * btn, lv_event_t e);
extern void call_log_update_call_log_info(call_status_t call_status, char * number, hal_rtc_t *time);
extern void call_log_ui_update(void);

/**********************
*      MACROS
**********************/

#endif /*USE_LV_WATCH_CALL_LOG*/

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /*CALL_LOG_H*/
